<template>
  <div class="container">
    <div class="c-header">
      <div class="header-left">
        <span class="name">{{datalist.village}}</span> <span>所属市县：</span
        ><span class="strong">{{datalist.city}}{{datalist.area}}</span><span>数据下发时间：</span
        ><span class="strong">{{datalist.time}}</span>
      </div>
      <div class="header-right">
        <button class="red" @click="back">返回</button>
        <button class="daochu">
          <img src="@/assets/daochu.png" alt="" /> <span>全部导出</span>
        </button>
      </div>
    </div>
    <div class="content">
      <ul class="content-left">
        <li
          v-for="(item, index) in list"
          :key="index"
          @click="chartSelect(index)"
        >
          <el-chart
            :data="item.data"
            :stageName="item.stageTitle"
          />
        </li>
      </ul>
      <div class="content-right">
        <div class="title">
          {{
            list[listSelectIndex].stage +
            "：" +
            list[listSelectIndex].stageTitle
          }}
        </div>

        <file-list
          v-for="item in list[listSelectIndex].fileList"
          :data="item.data"
          :fileTitle="item.title"
          :key="item.title"
        ></file-list>
      </div>
    </div>
  </div>
</template>
<script>
import elChart from "./components/huanChart";
import fileList from "./components/FileList";
export default {
  data() {
    return {
      list: [
        {
          stageTitle: "组织准备",
          stage: "第一阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
          fileList: [
            {
              title: "领导小组",
              data: [
                {
                  label: "附件材料",
                  children: [
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                  ],
                },
              ],
            },
            {
              title: "制定工作方案",
              data: [
                {
                  label: "附件材料",
                  children: [
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                  ],
                },
              ],
            },
            {
              title: "成立专家组",
              data: [
                {
                  label: "附件材料",
                  children: [
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          stageTitle: "技术准备",
          stage: "第二阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
          fileList: [
            {
              title: "动员培训",
              data: [
                {
                  label: "附件材料",
                  children: [
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                  ],
                },
              ],
            },
            {
              title: "基础数据收集",
              data: [
                {
                  label: "附件材料",
                  children: [
                    {
                      label: "XXXX文件",
                    },
                    {
                      label: "XXXX文件",
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          stageTitle: "驻村调查",
          stage: "第三阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
        },
        {
          stageTitle: "规划编制",
          stage: "第四阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
        },
        {
          stageTitle: "成果报批",
          stage: "第五阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
        },
        {
          stageTitle: "成果公告备案",
          stage: "第六阶段",
          data: [
            { value: 3, name: "aaa" },
            { value: 2, name: "bbb" },
          ],
        },
      ],
      listSelectIndex: 0,
      fileList: [],
      datalist:this.$route.query
    }; 
  },
  components: {
    elChart,
    fileList,
  },
  mounted(){
   
  },
  methods: {
    chartSelect(i) {
      this.listSelectIndex = i;
    },
    back(){
      this.$router.push("/rateRegister/overBox")
    }
  },
};
</script>
<style lang="scss" scoped>
.container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #f2f2f2;
}
.c-header {
  background-color: #fff;
  height: 55px;
  line-height: 55px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  .header-left {
    display: flex;
    align-items: center;
    span {
      margin-right: 10px;
      height: 40px;
      line-height: 40px;
    }
    .name {
      border-bottom: 2px solid #4778c7;
      margin-right: 15px;
    }
    .strong {
      color: #4778c7;
      font-size: 14px;
      font-weight: 700;
    }
  }
  .header-right {
    display: flex;
    align-items: center;
    button {
      height: 30px;
      line-height: 30px;
      text-align: center;
      margin-left: 10px;
      border-radius: 5px;
      color: #fff;
      border: none;
      padding: 0px 20px;
      font-weight: 400;
    }
    .red {
      background-color: #eeb4b4;
    }
    .green {
      background-color: #9acd32;
    }

    .daochu {
      display: flex;
      align-items: center;
      background-color: #4778c7;
      border-radius: 4px;
      height: 32px;
      margin-left: 15px;
      color: #fff;
      img {
        margin-right: 5px;
        width: 25px;
        height: 25px;
      }
    }
  }
}
.content {
  margin: 10px;
  position: relative;
  height: calc(100% - 75px);
  display: flex;
  justify-content: space-between;
  .content-left {
    list-style: none;
    margin: 0;
    padding: 30px;
    background-color: #fff;
    margin-right: 10px;
    width: 70%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li {
      width: 32%;
      height: 50%;
      margin-right: 10px;
      position: relative;
      p {
        text-align: center;
        height: 25px;
        line-height: 25px;
        font-size: 14px;
        font-weight: 600;
        margin: 0;
      }
    }
  }
  .content-right {
    background-color: #fff;
    width: 30%;
    height: 100%;
    padding: 10px;
    .title {
      background-color: #4778c7;
      height: 40px;
      line-height: 40px;
      color: white;
      padding: 0 10px;
      border-radius: 3px;
      margin-bottom: 10px;
    }
  }
}
</style>